package com.parking.order.model.form;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.*;
import java.time.LocalDateTime;

/**
 * 物业查询进出场信息日志Form
 * */
@Data
@ApiModel("物业查询进出场信息日志Form")
public class FindEntranceForm {
    /**
     * 页数
     * */
    @ApiModelProperty("页数")
    @NotNull(message = "pageNum不为空")
    @Min(message = "pageNum为正数",value = 1)
    private Integer pageNum;
    /**
     * 每页大小
     * */
    @ApiModelProperty("每页大小")
    @NotNull(message = "pageSize不为空")
    @Min(message = "pageSize为正数",value = 1)
    private Integer pageSize;
    /**
     * 车位号
     * */
    @ApiModelProperty("车位号")
    @Pattern(message = "stallInfo不符合格式", regexp = "^[A-Z]{1}[0-9]{3}$")
    private String stallInfo;
    /**
     * 订单编号
     * */
    @ApiModelProperty("订单编号")
    @Length(message = "orderInfoNum长度19")
    private String orderInfoNum;
    /**
     * 车牌号
     * */
    @ApiModelProperty("车牌号")
    @Pattern(message = "车牌号格式错误", regexp = "^[京津沪冀晋辽吉黑苏浙皖闽赣鲁豫鄂湘粤桂琼川黔云渝藏陕陇青宁新闽粤晋琼使领A_Z]{1}[A_Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$")
    private String entranceInfoPlate;
    /**
     * 开始时间
     * */
    @ApiModelProperty("开始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;
    /**
     * 结束时间
     * */
    @ApiModelProperty("结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;
    /**
     * 是否出场 0已出场 1未出场
     * */
    @ApiModelProperty("是否出场")
    @Min(message = "isOut不存在",value = 0)
    @Max(message = "isOut不存在",value = 1)
    private Integer isOut;
}
